package com.cloud.common.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 李均华
 * @date 2021/6/4
 * @desc 远程调用商品服务
 */
@FeignClient(name = "shop-product")
//@LoadBalancerClient(name = "shop-product", configuration = ProductLoadBalancerConfig.class)
public interface ProductService {

    /**
     * 减去库存
     * @param id 商品id
     * @param num 数量
     * @return 下单数量
     */
    @GetMapping("/shop/product/reduceProduct/{id}/{num}")
    Integer reduceProduct(@PathVariable("id") Integer id, @PathVariable("num") Integer num);

}
